﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Model;
using gfLibrary;
using System.Drawing;
using IYAKASAPortal.Services;
using System.Data;
using System.Xml.Linq;
using System.IO;
using System.Xml;
using System.Collections;
using System.Text;
using System.Web.Services;

namespace IYAKASAPortal.Login
{
     public partial class LoginPQ : System.Web.UI.Page
    {
        private UserInfo userInfo { get; set; }
        private static List<ListItem> lstItems { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserName"] != null && Session["UserName"].ToString() != "")
            {
                string userName = Session["UserName"].ToString();
                userInfo = IYAKASAPortal.Services.UserAuthority.GetUserAuthority(userName);
            }
            else
            {
                gfJs.RunFunction(this.Page, "parent.window.location = '../logout.aspx';");
            }

            if (!IsPostBack)
            {
                BindData();
            }
        }

        private void BindData()
        {
            CONST_DEFINE_BLL bll = new CONST_DEFINE_BLL();
            ListItem item;

            //号牌颜色
            var hpys = bll.GetModelList("CON_CHNAME='PQHPZL' order by CON_ORDER asc");
            foreach (var v in hpys)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpHPYS.Items.Add(item);
            }

            //号牌种类
            var hpzl = bll.GetModelList("CON_CHNAME='HPZL' order by CON_ORDER asc");
            foreach (var v in hpzl)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpHPZL.Items.Add(item);
            }

            //检验类别
            var def = bll.GetModelList("CON_CHNAME='JYLB' and CON_VTYPE='2' order by CON_ORDER asc");
            foreach (var v in def)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpJCLB.Items.Add(item);
            }

            //车辆种类
            var clzl = bll.GetModelList("CON_CHNAME='CLZL' and SUBSTRING(CON_CODE,1,1)<>'B' and SUBSTRING(CON_CODE,1,1)<>'G' order by CON_ORDER asc");
            foreach (var v in clzl)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpCLZL.Items.Add(item);
            }

            //燃油种类
            var ryzl = bll.GetModelList("CON_CHNAME='RLLB' order by CON_ORDER asc");
            foreach (var v in ryzl)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpRYZL.Items.Add(item);
            }

            Dictionary<string, string> bh = new Dictionary<string, string>();
            bh.Add("90#", "90#");
            bh.Add("0#", "0#");
            bh.Add("92#", "92#");
            bh.Add("95#", "95#");
            bh.Add("-10#", "-10#");
            bh.Add("98#", "98#");
            foreach (var v in bh)
            {
                item = new ListItem();
                item.Text = v.Value;
                item.Value = v.Key;
                drpPH.Items.Add(item);
            }
            item = new ListItem();

            //使用性质
            var syxz = bll.GetModelList("CON_CHNAME='SYXZ' order by CON_ORDER asc");
            foreach (var v in syxz)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpSYXZ.Items.Add(item);
            }

            //驱动方式
            var qdfs = bll.GetModelList("CON_CHNAME='QDXS' order by CON_ORDER asc");
            foreach (var v in qdfs)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpQDFS.Items.Add(item);
            }

            //进气方式
            var jqfs = bll.GetModelList("CON_CHNAME='JQFS' order by CON_ORDER asc");
            foreach (var v in jqfs)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpJQFS.Items.Add(item);
            }

            //供油方式
            var gyfs = bll.GetModelList("CON_CHNAME='GYFS' order by CON_ORDER asc");
            foreach (var v in gyfs)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpGYFS.Items.Add(item);
            }

            //驱动轴位置
            for (int i = 1; i < 6; i++)
            {
                item = new ListItem();
                item.Text = i.ToString();
                item.Value = i.ToString();
                chkQDZWZ.Items.Add(item);
            }

            chkQDZWZ.Items[1].Selected = true;

            //变数器类型
            var bsxlx = bll.GetModelList("CON_CHNAME='BSXLX' order by CON_ORDER asc");
            foreach (var v in bsxlx)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpBSQXS.Items.Add(item);
            }

            //催化转化器
            var chzhq = bll.GetModelList("CON_CHNAME='CHZHQQK' order by CON_ORDER asc");
            foreach (var v in chzhq)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpCHZHQ.Items.Add(item);
            }

            //排气后处理装置
            var pqhclzz = bll.GetModelList("CON_CHNAME='PQHCLZZ' order by CON_ORDER asc");
            foreach (var v in pqhclzz)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpPQHCLZZ.Items.Add(item);
            }

            //使用情况
            var syqk = bll.GetModelList("CON_CHNAME='SYQK' order by CON_ORDER asc");
            foreach (var v in syqk)
            {
                item = new ListItem();
                item.Text = v.CON_CON;
                item.Value = v.CON_CODE;
                drpSYQK.Items.Add(item);
            }

            BindJCFF(drpCLZL.SelectedValue, drpRYZL.SelectedValue, drpQDFS.SelectedValue, txtSCRQ.Text.Trim());

            CONST_DEFINE_WEB_CATEGORY_BLL category_bll = new CONST_DEFINE_WEB_CATEGORY_BLL();
            var hphmStart = category_bll.GetModel(8);
            txtHPHMStart.Text = hphmStart.CategoryName;

            var keyValue = category_bll.GetModel(9);
            hidKeyValue.Value = keyValue.CategoryName;
        }

        private void BindJCFF(string strCLZL, string strRYZL, string strQDFS, string strSCRQ)
        {
            CONST_DEFINE_BLL bll = new CONST_DEFINE_BLL();
            var jyxm = bll.GetModelList("CON_CHNAME='JYXM' and SUBSTRING(CON_CODE,1,1)='X' order by CON_ORDER asc");
            Dictionary<string, string> dic = new Dictionary<string, string>();
            foreach (var v in jyxm)
            {
                dic.Add(v.CON_CODE, v.CON_CON);
            }

            rbtnJCFF.Items.Clear();

            List<KeyValuePair<string, string>> lst = new List<KeyValuePair<string, string>>();
            if (strCLZL == "H51" || strCLZL == "H52" || strCLZL == "H53" || strCLZL == "H54" || strCLZL == "H55" || strCLZL == "H5B" || strCLZL == "H5C" || strCLZL == "N11")
            {
                lst = dic.Where(x => x.Key == "X6").ToList();
            }
            else
            {
                if (strRYZL == "A")
                {//汽油
                    //双怠速
                    //VMAS
                    lst = dic.Where(x => x.Key == "X1" || x.Key == "X3").ToList();
                    if (strQDFS == "203")
                    {//四驱
                        //双怠速
                        lst = lst.Where(x => x.Key == "X1").ToList();
                    }
                }
                else
                {//柴油
                    //LugDown
                    //自由加速
                    lst = dic.Where(x => x.Key == "X4" || x.Key == "X6" || x.Key == "X5").ToList();
                    //自由加速

                    if (string.IsNullOrEmpty(strSCRQ) == false)
                    {
                        try
                        {
                            if (Convert.ToDateTime(strSCRQ) < Convert.ToDateTime("2000-10-1"))
                            {
                                //滤纸
                                lst = lst.Where(x => x.Key != "X4").ToList();
                            }
                            else
                            {
                                //不透光
                                lst = lst.Where(x => x.Key != "X6").ToList();
                            }
                        }
                        catch (Exception ex)
                        {
 
                        }
                    }
                }
            }

            foreach (var v in lst)
            {
                rbtnJCFF.Items.Add(new ListItem() { Text = v.Value, Value = v.Key });
            }
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strHPHM = txtHPHMStart.Text.Trim().ToUpper() + txtHPHM.Text.Trim().ToUpper();
            string strHPHM_H = txtHPHMStart.Text.Trim().ToUpper();
            string strHPHM_C = txtHPHM.Text.Trim().ToUpper();
            string strHPZL = drpHPZL.SelectedValue.Trim();
            string strJCLB = drpJCLB.SelectedValue.Trim();
            string strVIN = txtVIN.Text.Trim();
            string strSYR = txtOwner.Text.Trim();
            string strAddress = txtAddress.Text.Trim();
            string strPP = txtPP.Text.Trim();
            string strXH = txtXH.Text.Trim();
            string strSCC = txtSCC.Text.Trim();
            string strZBZL = txtZBZL.Text.Trim();
            string strZZL = txtZZL.Text.Trim();
            string strDJRQ = txtDJRQ.Text.Trim();
            string strSCRQ = txtSCRQ.Text.Trim();
            string strPhone = txtPhone.Text.Trim();
            string strFDJH = txtFDJH.Text.Trim();
            string strCPMC = txtCPMC.Text.Trim();
            string strEDGL = txtEDGL.Text.Trim();
            string strEDZS = txtEDNJZS.Text.Trim();
            string strLCBDS = txtLCBDS.Text.Trim();
            string strDCZZ = txtDCZZ.Text.Trim();
            string strLTQY = txtLTQY.Text.Trim();
            string strDWS = txtDWS.Text.Trim();
            string strPL = txtPL.Text.Trim();
            string strFDJXH = txtFDJXH.Text.Trim();
            string strQGS = txtQGS.Text.Trim();

            if (string.IsNullOrEmpty(strHPHM_H))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "号牌号码开头不能为空！");
                txtHPHMStart.Focus();
                txtHPHMStart.BackColor = Color.Yellow;
                return;
            }
            else
            {
                txtHPHMStart.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strHPHM_C))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "号牌号码不能为空！");
                txtHPHM.Focus();
                txtHPHM.BackColor = Color.Yellow;
                return;
            }
            else
            {
                txtHPHM.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strVIN) == false)
            {
                txtVIN.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strSYR) == false)
            {
                txtOwner.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strAddress) == false)
            {
                txtAddress.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strPP) == false)
            {
                txtPP.BackColor = Color.White;
            }


            if (string.IsNullOrEmpty(strXH) == false)
            {
                txtXH.BackColor = Color.White;
            }


            if (string.IsNullOrEmpty(strSCC) == false)
            {
                txtSCC.BackColor = Color.White;
            }


            if (string.IsNullOrEmpty(strZBZL) == false)
            {
                if (!gfValidate.Is_Integer(strZBZL))
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "整备质量只能为整数！");
                    txtZBZL.BackColor = Color.Yellow;
                    return;
                }
                else
                {
                    txtZBZL.BackColor = Color.White;
                }
            }
            else
            {
                txtZBZL.BackColor = Color.White;
            }


            if (string.IsNullOrEmpty(strZZL) == false)
            {
                if (!gfValidate.Is_Integer(strZZL))
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "总质量只能为整数！");
                    txtZZL.BackColor = Color.Yellow;
                    return;
                }
                else
                {
                    txtZZL.BackColor = Color.White;
                }
            }
            else
            {
                txtZZL.BackColor = Color.White;
            }


            if (string.IsNullOrEmpty(strDJRQ) == false)
            {
                if (gfValidate.Is_DateTime(strDJRQ) == false)
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "初始登记日期不是日期格式！");
                    txtDJRQ.BackColor = Color.Yellow;
                    return;
                }
                else
                {
                    txtDJRQ.BackColor = Color.White;
                }
            }
            else
            {
                txtDJRQ.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strSCRQ) == false)
            {
                if (gfValidate.Is_DateTime(strSCRQ) == false)
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "初始登记日期不是日期格式！");
                    txtSCRQ.BackColor = Color.Yellow;
                    return;
                }
                else
                {
                    txtSCRQ.BackColor = Color.White;
                }
            }
            else
            {
                txtSCRQ.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strQGS) == false)
            {
                if (gfValidate.Is_Integer(strQGS) == false)
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "气缸数只能是整数！");
                    txtQGS.BackColor = Color.Yellow;
                    return;
                }
                else
                {
                    txtQGS.BackColor = Color.White;
                }
            }
            else
            {
                txtQGS.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strPhone) == false)
            {
                txtPhone.BackColor = Color.White;
            }

            if (string.IsNullOrEmpty(strFDJH) == false)
            {
                txtFDJH.BackColor = Color.White;
            }

            
            if (string.IsNullOrEmpty(strCPMC) ==false)
            {
                txtCPMC.BackColor = Color.White;
            }

           
            if (string.IsNullOrEmpty(strPL) == false)
            {
                txtPL.BackColor = Color.White;
            }


            if (string.IsNullOrEmpty(strEDGL) == false)
            {
                if (!gfValidate.Is_Float(strEDGL))
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "额定功率只能为数字格式！");
                    txtEDGL.BackColor = Color.Yellow;
                    return;
                }
                else
                {
                    txtEDGL.BackColor = Color.White;
                }
            }
            else
            {
                txtEDGL.BackColor = Color.White;
            }


            if (string.IsNullOrEmpty(strEDZS) == false)
            {
                if (!gfValidate.Is_Integer(strEDZS))
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "额定转速只能为整数！");
                    txtEDNJZS.BackColor = Color.Yellow;
                    return;
                }
                else
                {
                    txtEDNJZS.BackColor = Color.White;
                }
            }
            else
            {
                txtEDNJZS.BackColor = Color.White;
            }


            if (string.IsNullOrEmpty(strLCBDS) == false)
            {
                if (!gfValidate.Is_Integer(strLCBDS))
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "里程表读数只能为整数！");
                    txtLCBDS.BackColor = Color.Yellow;
                    return;
                }
                else
                {
                    txtLCBDS.BackColor = Color.White;
                }
            }
            else
            {
                txtLCBDS.BackColor = Color.White;
            }


            if (string.IsNullOrEmpty(strDCZZ) == false)
            {
                if (!gfValidate.Is_Integer(strDCZZ))
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "单车轴重只能为整数！");
                    txtDCZZ.BackColor = Color.Yellow;
                    return;
                }
                else
                {
                    txtDCZZ.BackColor = Color.White;
                }
            }
            else
            {
                txtDCZZ.BackColor = Color.White;
            }


            if (string.IsNullOrEmpty(strLTQY) == false)
            {
                if (!gfValidate.Is_Float(strLTQY))
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "轮胎气压只能为整数！");
                    txtLTQY.BackColor = Color.Yellow;
                    return;
                }
            }
            else
            {
                txtLTQY.BackColor = Color.White;
            }

          
            if (string.IsNullOrEmpty(strFDJXH) == false)
            {
                txtFDJXH.BackColor = Color.White;
            }

          
            if (string.IsNullOrEmpty(strDWS) == false)
            {
                if (gfValidate.Is_Integer(strDWS) == false)
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "档位数只能是整数！");
                    txtDWS.BackColor = Color.Yellow;
                    return;
                }
                else
                {
                    txtDWS.BackColor = Color.White;
                }
            }
            else
            {
                txtDWS.BackColor = Color.White;
            }

            bool b = false;
            for (int i = 0; i < rbtnJCFF.Items.Count; i++)
            {
                if (rbtnJCFF.Items[i].Selected)
                {
                    b = true;
                    break;
                }
            }

            //驱动轴位置
            string strQDZWZ = "";
            for (int i = 0; i < chkQDZWZ.Items.Count; i++)
            {
                if (chkQDZWZ.Items[i].Selected)
                {
                    strQDZWZ += chkQDZWZ.Items[i].Value + ",";
                }
            }

            //if (b == false)
            //{
            //    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "请选择检测方法！");
            //    return;
            //}

            //if (Convert.ToInt32(strZZL) > 3500 && drpRYZL.SelectedValue == "A")
            //{
            //    if(rbtnJCFF.SelectedValue != "X1")
            //    {
            //        gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "检测方法只能选择双怠速！");
            //        rbtnJCFF.SelectedValue = "X1";
            //        return;
            //    }
            //}

            string strJYXM = rbtnJCFF.SelectedValue + ",";

            string strVEHICLEID = strHPZL + strHPHM;

            LOGIN_VEHICLE_INFO info = new LOGIN_VEHICLE_INFO();
            info.VEHICLEID = strVEHICLEID;
            info.HPHM = strHPHM;
            info.VIN = strVIN;
            info.HPZL = drpHPZL.SelectedItem.Text;
            info.HPZLDH = strHPZL;
            info.SYR = strSYR;
            info.LXDZ = strAddress;
            info.PP = strPP;
            info.XH = strXH;
            info.PPXH = strPP + strXH;
            info.CLZZCS = txtSCC.Text.Trim();
            info.CLZL = drpCLZL.SelectedItem.Text;
            info.CLZLDH = drpCLZL.SelectedItem.Value;
            info.RLLB = drpRYZL.SelectedItem.Text;
            info.RLLBDH = drpRYZL.SelectedValue;
            info.RYBH = drpPH.SelectedItem.Text;
            info.DWS = strDWS;
            info.ZBZL = strZBZL;
            info.ZZL = strZZL;
            info.CYS = txtHZRS.Text;
            info.CCDJRQ = strDJRQ;
            info.CCRQ = strSCRQ;
            info.LXDH = strPhone;
            info.FDJH = strFDJH;
            info.SYXZ = drpSYXZ.SelectedItem.Text;
            info.SYXZDH = drpSYXZ.SelectedItem.Value;
            info.QDXS = drpQDFS.SelectedItem.Text;
            info.QDXSDH = drpQDFS.SelectedItem.Value;
            info.JQFS = drpJQFS.SelectedItem.Text;
            info.JQFSDH = drpJQFS.SelectedItem.Value;
            info.GYFS = drpGYFS.SelectedItem.Text;
            info.GYFSDH = drpGYFS.SelectedItem.Value;
            info.FDJGS = strQGS;
            info.FDJPL = strPL;
            info.BSXLX = drpBSQXS.SelectedItem.Text;
            info.BSXLXDH = drpBSQXS.SelectedItem.Value;
            info.CHZHQQK = drpCHZHQ.SelectedItem.Text;
            info.CHZHQQKDH = drpCHZHQ.SelectedItem.Value;
            info.PQHCLZZ = drpPQHCLZZ.SelectedItem.Text;
            info.PQHCLZZDH = drpPQHCLZZ.SelectedItem.Value;
            info.EDGL = strEDGL;
            info.EDZS = strEDZS;
            info.LJXSLC = strLCBDS;
            info.DCZZ = strDCZZ;
            info.LTQY = strLTQY;
            info.QDZWZ = strQDZWZ;
            info.FDJXH = strFDJXH;
            info.JYLB = drpJCLB.SelectedItem.Text;
            info.JYLBDH = drpJCLB.SelectedValue + ",";
            info.JYXM = strJYXM;
            info.SYQK = drpSYQK.SelectedItem.Text;
            info.SYQKDH = drpSYQK.SelectedValue;
            info.CPMC = strCPMC;
            info.HPYS = drpHPYS.SelectedItem.Text;
            info.HPYSDH = drpHPYS.SelectedItem.Value;

            LOGIN_VEHICLE_INFO_BLL bll = new LOGIN_VEHICLE_INFO_BLL();

            if (string.IsNullOrEmpty(userInfo.UserName))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "当前没有授权,请退出系统重新登录！");
                return;
            }

            bool bOnGoing = LoginHelper.GetVehicleStatus(strVEHICLEID);
            if (bOnGoing)
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "车辆【" + strVEHICLEID + "】正在检测，不能保存当前信息！");
                return;
            }

            var vInfo = LoginHelper.GetLoginInfo(strHPHM, strHPZL);

            if (vInfo == null)
            {
                if (bll.Insert(info) == true)
                {
                    hidID.Value = LoginHelper.GetLoginInfo(strHPHM, strHPZL).ID.ToString();
                    LoginHelper.SavePPXHAndFDJXH(info);
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "车牌号码【" + strHPHM + "】保存成功！");
                    btnSend.Enabled = true;
                    btnSend.CssClass = "btnSendEnabled";
                }
                else
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "车牌号码【" + strHPHM + "】保存失败！");
                    return;
                }
            }
            else
            {
                if (bll.Update(info, vInfo.ID) == true)
                {
                    hidID.Value = vInfo.ID.ToString();
                    LoginHelper.SavePPXHAndFDJXH(info);
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "车牌号码【" + strHPHM + "】更新成功！");
                    btnSend.Enabled = true;
                    btnSend.CssClass = "btnSendEnabled";
                }
                else
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "车牌号码【" + strHPHM + "】更新失败！");
                    return;
                }
            }

        }

        private void ResetAll()
        {
            List<LoginHelper.ControlNames> lstCtl = new List<LoginHelper.ControlNames>();
            List<Control> lstControls = new List<Control>();

            lstCtl.Add(new LoginHelper.ControlNames(drpHPYS.ID, ""));
            lstControls.Add(drpHPYS);

            lstCtl.Add(new LoginHelper.ControlNames(drpHPZL.ID, ""));
            lstControls.Add(drpHPZL);

            lstCtl.Add(new LoginHelper.ControlNames(drpJCLB.ID, ""));
            lstControls.Add(drpJCLB);

            lstCtl.Add(new LoginHelper.ControlNames(drpCLZL.ID, ""));
            lstControls.Add(drpCLZL);

            lstCtl.Add(new LoginHelper.ControlNames(drpRYZL.ID, ""));
            lstControls.Add(drpRYZL);

            lstCtl.Add(new LoginHelper.ControlNames(drpPH.ID, ""));
            lstControls.Add(drpPH);

            lstCtl.Add(new LoginHelper.ControlNames(drpSYXZ.ID, ""));
            lstControls.Add(drpSYXZ);

            lstCtl.Add(new LoginHelper.ControlNames(drpQDFS.ID, ""));
            lstControls.Add(drpQDFS);

            lstCtl.Add(new LoginHelper.ControlNames(drpJQFS.ID, ""));
            lstControls.Add(drpJQFS);

            lstCtl.Add(new LoginHelper.ControlNames(drpGYFS.ID, ""));
            lstControls.Add(drpGYFS);

            lstCtl.Add(new LoginHelper.ControlNames(txtQGS.ID, ""));
            lstControls.Add(txtQGS);

            lstCtl.Add(new LoginHelper.ControlNames(drpBSQXS.ID, ""));
            lstControls.Add(drpBSQXS);

            lstCtl.Add(new LoginHelper.ControlNames(drpCHZHQ.ID, ""));
            lstControls.Add(drpCHZHQ);

            lstCtl.Add(new LoginHelper.ControlNames(drpPQHCLZZ.ID, ""));
            lstControls.Add(drpPQHCLZZ);

            lstCtl.Add(new LoginHelper.ControlNames(drpSYQK.ID, ""));
            lstControls.Add(drpSYQK);

            lstCtl.Add(new LoginHelper.ControlNames(txtHZRS.ID, ""));
            lstControls.Add(txtHZRS);

            lstCtl.Add(new LoginHelper.ControlNames(txtDWS.ID, ""));
            lstControls.Add(txtDWS);

            lstCtl.Add(new LoginHelper.ControlNames(txtPP.ID, ""));
            lstControls.Add(txtPP);

            lstCtl.Add(new LoginHelper.ControlNames(txtXH.ID, ""));
            lstControls.Add(txtXH);

            lstCtl.Add(new LoginHelper.ControlNames(txtHPHM.ID, ""));
            lstControls.Add(txtHPHM);

            lstCtl.Add(new LoginHelper.ControlNames(txtVIN.ID, ""));
            lstControls.Add(txtVIN);

            lstCtl.Add(new LoginHelper.ControlNames(txtOwner.ID, ""));
            lstControls.Add(txtOwner);

            lstCtl.Add(new LoginHelper.ControlNames(txtSCC.ID, ""));
            lstControls.Add(txtSCC);

            lstCtl.Add(new LoginHelper.ControlNames(txtZBZL.ID, ""));
            lstControls.Add(txtZBZL);

            lstCtl.Add(new LoginHelper.ControlNames(txtZZL.ID, ""));
            lstControls.Add(txtZZL);

            lstCtl.Add(new LoginHelper.ControlNames(txtDJRQ.ID, ""));
            lstControls.Add(txtDJRQ);

            lstCtl.Add(new LoginHelper.ControlNames(txtSCRQ.ID, ""));
            lstControls.Add(txtSCRQ);

            lstCtl.Add(new LoginHelper.ControlNames(txtPhone.ID, ""));
            lstControls.Add(txtPhone);

            lstCtl.Add(new LoginHelper.ControlNames(txtFDJH.ID, ""));
            lstControls.Add(txtFDJH);

            lstCtl.Add(new LoginHelper.ControlNames(txtCPMC.ID, ""));
            lstControls.Add(txtCPMC);

            lstCtl.Add(new LoginHelper.ControlNames(txtPL.ID, ""));
            lstControls.Add(txtPL);

            lstCtl.Add(new LoginHelper.ControlNames(txtEDGL.ID, ""));
            lstControls.Add(txtEDGL);

            lstCtl.Add(new LoginHelper.ControlNames(txtEDNJZS.ID, ""));
            lstControls.Add(txtEDNJZS);

            lstCtl.Add(new LoginHelper.ControlNames(txtLCBDS.ID, ""));
            lstControls.Add(txtLCBDS);

            lstCtl.Add(new LoginHelper.ControlNames(txtDCZZ.ID, ""));
            lstControls.Add(txtDCZZ);

            lstCtl.Add(new LoginHelper.ControlNames(txtLTQY.ID, ""));
            lstControls.Add(txtLTQY);

            lstCtl.Add(new LoginHelper.ControlNames(txtFDJXH.ID, ""));
            lstControls.Add(txtFDJXH);

            lstCtl.Add(new LoginHelper.ControlNames(chkQDZWZ.ID, "2,"));
            lstControls.Add(chkQDZWZ);

            LoginHelper.ResetAllControls(lstCtl, lstControls);

            hidID.Value = "";
            btnSave.Enabled = true;
            btnSave.CssClass = "btnSaveEnabled";
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            string strHPHM = txtHPHMStart.Text.Trim().ToUpper() + txtHPHM.Text.Trim().ToUpper();
            string strVIN = txtVIN.Text.Trim();
            string strHPZL = drpHPZL.SelectedValue;

            if (string.IsNullOrEmpty(strHPHM) && string.IsNullOrEmpty(strVIN))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "请输入号牌号码或者VIN进行查询！");
                return;
            }

            if (chkSFLW.Checked)
            {

                string strJYJGBH = "xxxx";

                string xtlb = "";//系统类别
                //接口提供者的业务类别代码，默认为“18”（代表机动车检验监管系统）
                string jkxlh = "";//接口序列号
                //由外挂系统请求服务平台授权生成下发
                string jkid = "";//接口标志
                //5位，由系统类别＋C＋两位接口顺序号组成，用于唯一表示一个接口。

                var doc = new XDocument(
                    new XElement("root",
                        new XElement("QueryCondition",
                            new XElement("hphm", strHPHM),
                            new XElement("hpzl", strHPZL),
                            new XElement("clsbdh", strVIN),
                            new XElement("jyjgbh", strJYJGBH)
                            )
                        )
                    );
                string QueryXmlDoc = doc.ToString();
                //localhost.myWebService call = new localhost.myWebService();
                string result = "";// call.queryObjectOutw(xtlb, jkxlh, jkid, QueryXmlDoc);
                //HttpUtility.UrlDecode(result, System.Text.Encoding.UTF8);

                StringReader reader = new StringReader(result);
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load(reader);
                string code = xmlDoc.SelectSingleNode("//code").InnerText;
                XmlNode root = xmlDoc.SelectSingleNode("//vehispara");
                if (code == "1")
                {
                    if (root != null)
                    {
                        LOGIN_VEHICLE_INFO info = new LOGIN_VEHICLE_INFO();
                        info.HPHM = root.SelectSingleNode("clhm").InnerText;
                        info.HPZLDH = root.SelectSingleNode("hpzl").InnerText;
                        info.VIN = root.SelectSingleNode("vin").InnerText;
                        info.JYLBDH = root.SelectSingleNode("jclb").InnerText;
                        info.SYR = root.SelectSingleNode("czxm").InnerText;
                        info.LXDZ = root.SelectSingleNode("czdz").InnerText;
                        info.PPXH = root.SelectSingleNode("ppxh").InnerText;
                        info.CLZZCS = root.SelectSingleNode("scc").InnerText;
                        info.CLZLDH = root.SelectSingleNode("cllx").InnerText;
                        info.RLLBDH = root.SelectSingleNode("ryzl").InnerText;
                        info.RYBH = root.SelectSingleNode("ph").InnerText;
                        info.ZBZL = root.SelectSingleNode("zbzl").InnerText;
                        info.ZZL = root.SelectSingleNode("zzl").InnerText;
                        info.CYS = root.SelectSingleNode("zkrs").InnerText;
                        info.CCDJRQ = root.SelectSingleNode("djrq").InnerText;
                        info.CCRQ = root.SelectSingleNode("scrq").InnerText;
                        info.LXDH = root.SelectSingleNode("czdh").InnerText;
                        info.FDJH = root.SelectSingleNode("fdjh").InnerText;
                        info.SYXZDH = root.SelectSingleNode("syxz").InnerText;
                        info.QDXSDH = root.SelectSingleNode("qdfs").InnerText;
                        info.JQFSDH = root.SelectSingleNode("jqfs").InnerText;
                        info.GYFSDH = root.SelectSingleNode("gyfs").InnerText;
                        //info.QDXSDH = root.SelectSingleNode("qdzs").InnerText;
                        info.PP = root.SelectSingleNode("cpmc").InnerText;
                        info.FDJGS = root.SelectSingleNode("qgs").InnerText;
                        info.FDJPL = root.SelectSingleNode("pl").InnerText;
                        info.BSXLXDH = root.SelectSingleNode("bsqxs").InnerText;
                        info.CHZHQQKDH = root.SelectSingleNode("chzhq").InnerText;
                        info.PQHCLZZDH = root.SelectSingleNode("pqhclzz").InnerText;
                        info.EDGL = root.SelectSingleNode("edgl").InnerText;
                        info.EDZS = root.SelectSingleNode("edzs").InnerText;
                        info.LJXSLC = root.SelectSingleNode("lcbds").InnerText;
                        info.DCZZ = root.SelectSingleNode("dczz").InnerText;
                        info.LTQY = root.SelectSingleNode("ltqy").InnerText;
                        //info.DWS = root.SelectSingleNode("dws").InnerText;
                        info.FDJXH = root.SelectSingleNode("fdjxh").InnerText;
                        //info.SYQK = root.SelectSingleNode("syqk").InnerText;

                        LoadData(info);

                    }
                    else
                    {
                        gfAjaxJs.SetAlertMsg(UpdatePanel1, "查询失败,节点为空！");
                    }
                }
                else
                {
                    gfAjaxJs.SetAlertMsg(UpdatePanel1, "查询失败,下载失败！");
                    //return;
                }

            }
            else
            {
                LOGIN_VEHICLE_INFO_BLL bll = new LOGIN_VEHICLE_INFO_BLL();
                string strSql = "";
                if (!string.IsNullOrEmpty(strHPHM))
                {
                    strSql = "VEHICLEID='" + drpHPZL.SelectedValue + strHPHM + "'  and HPZLDH='" + strHPZL + "'";
                }
                else if (!string.IsNullOrEmpty(strVIN))
                {
                    strSql = "VIN='" + strVIN + "'  and HPZLDH='" + strHPZL + "'";
                }

                LOGIN_VEHICLE_INFO[] infos = bll.GetModelList(strSql);

                if (infos.Length == 1)
                {
                    LoadData(infos[0]);
                    hidID.Value = infos[0].ID.ToString();
                    btnSend.Enabled = false;
                    btnSend.CssClass = "btnSendDisabled";
                }
                else if (infos.Length > 1)
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "查询结果大于1条，显示为第一条！");
                    LoadData(infos[0]);
                    hidID.Value = infos[0].ID.ToString();
                    btnSend.Enabled = false;
                    btnSend.CssClass = "btnSendDisabled";
                }
                else
                {
                    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "查询结果为空！");
                    btnSend.Enabled = false;
                    btnSend.CssClass = "btnSendDisabled";
                    ResetAll();
                }
            }
        }

        private void LoadData(LOGIN_VEHICLE_INFO login_Info)
        {
            List<LoginHelper.ControlNames> lstCtl = new List<LoginHelper.ControlNames>();
            List<Control> lstControls = new List<Control>();

            lstCtl.Add(new LoginHelper.ControlNames(drpHPYS.ID, "HPYSDH"));
            lstControls.Add(drpHPYS);

            lstCtl.Add(new LoginHelper.ControlNames(drpHPZL.ID, "HPZLDH"));
            lstControls.Add(drpHPZL);

            lstCtl.Add(new LoginHelper.ControlNames(drpJCLB.ID, "JYLBDH"));
            lstControls.Add(drpJCLB);

            lstCtl.Add(new LoginHelper.ControlNames(drpCLZL.ID, "CLZLDH"));
            lstControls.Add(drpCLZL);

            lstCtl.Add(new LoginHelper.ControlNames(drpRYZL.ID, "RLLBDH"));
            lstControls.Add(drpRYZL);

            lstCtl.Add(new LoginHelper.ControlNames(drpPH.ID, "RYBH"));
            lstControls.Add(drpPH);

            lstCtl.Add(new LoginHelper.ControlNames(drpSYXZ.ID, "SYXZDH"));
            lstControls.Add(drpSYXZ);

            lstCtl.Add(new LoginHelper.ControlNames(drpQDFS.ID, "QDXSDH"));
            lstControls.Add(drpQDFS);

            lstCtl.Add(new LoginHelper.ControlNames(drpJQFS.ID, "JQFSDH"));
            lstControls.Add(drpJQFS);

            lstCtl.Add(new LoginHelper.ControlNames(drpGYFS.ID, "GYFSDH"));
            lstControls.Add(drpGYFS);

            lstCtl.Add(new LoginHelper.ControlNames(txtQGS.ID, "FDJGS"));
            lstControls.Add(txtQGS);

            lstCtl.Add(new LoginHelper.ControlNames(drpBSQXS.ID, "BSXLXDH"));
            lstControls.Add(drpBSQXS);

            lstCtl.Add(new LoginHelper.ControlNames(drpCHZHQ.ID, "CHZHQQKDH"));
            lstControls.Add(drpCHZHQ);

            lstCtl.Add(new LoginHelper.ControlNames(drpPQHCLZZ.ID, "PQHCLZZDH"));
            lstControls.Add(drpPQHCLZZ);

            lstCtl.Add(new LoginHelper.ControlNames(drpSYQK.ID, "SYQKDH"));
            lstControls.Add(drpSYQK);

            lstCtl.Add(new LoginHelper.ControlNames(txtHZRS.ID, "CYS"));
            lstControls.Add(txtHZRS);

            lstCtl.Add(new LoginHelper.ControlNames(txtDWS.ID, "DWS"));
            lstControls.Add(txtDWS);

            lstCtl.Add(new LoginHelper.ControlNames(txtPP.ID, "PP"));
            lstControls.Add(txtPP);

            lstCtl.Add(new LoginHelper.ControlNames(txtXH.ID, "XH"));
            lstControls.Add(txtXH);

            lstCtl.Add(new LoginHelper.ControlNames(txtHPHM.ID, "HPHM"));
            lstControls.Add(txtHPHM);

            lstCtl.Add(new LoginHelper.ControlNames(txtVIN.ID, "VIN"));
            lstControls.Add(txtVIN);

            lstCtl.Add(new LoginHelper.ControlNames(txtOwner.ID, "SYR"));
            lstControls.Add(txtOwner);

            lstCtl.Add(new LoginHelper.ControlNames(txtSCC.ID, "CLZZCS"));
            lstControls.Add(txtSCC);

            lstCtl.Add(new LoginHelper.ControlNames(txtZBZL.ID, "ZBZL"));
            lstControls.Add(txtZBZL);

            lstCtl.Add(new LoginHelper.ControlNames(txtZZL.ID, "ZZL"));
            lstControls.Add(txtZZL);

            lstCtl.Add(new LoginHelper.ControlNames(txtDJRQ.ID, "CCDJRQ"));
            lstControls.Add(txtDJRQ);

            lstCtl.Add(new LoginHelper.ControlNames(txtSCRQ.ID, "CCRQ"));
            lstControls.Add(txtSCRQ);

            lstCtl.Add(new LoginHelper.ControlNames(txtPhone.ID, "LXDH"));
            lstControls.Add(txtPhone);

            lstCtl.Add(new LoginHelper.ControlNames(txtFDJH.ID, "FDJH"));
            lstControls.Add(txtFDJH);

            lstCtl.Add(new LoginHelper.ControlNames(txtPL.ID, "FDJPL"));
            lstControls.Add(txtPL);

            lstCtl.Add(new LoginHelper.ControlNames(txtEDGL.ID, "EDGL"));
            lstControls.Add(txtEDGL);

            lstCtl.Add(new LoginHelper.ControlNames(txtEDNJZS.ID, "EDZS"));
            lstControls.Add(txtEDNJZS);

            lstCtl.Add(new LoginHelper.ControlNames(txtLCBDS.ID, "LJXSLC"));
            lstControls.Add(txtLCBDS);

            lstCtl.Add(new LoginHelper.ControlNames(txtDCZZ.ID, "DCZZ"));
            lstControls.Add(txtDCZZ);

            lstCtl.Add(new LoginHelper.ControlNames(txtLTQY.ID, "LTQY"));
            lstControls.Add(txtLTQY);

            lstCtl.Add(new LoginHelper.ControlNames(txtFDJXH.ID, "FDJXH"));
            lstControls.Add(txtFDJXH);

            lstCtl.Add(new LoginHelper.ControlNames(chkQDZWZ.ID, "QDZWZ"));
            lstControls.Add(chkQDZWZ);

            lstCtl.Add(new LoginHelper.ControlNames(txtAddress.ID, "LXDZ"));
            lstControls.Add(txtAddress);

            lstCtl.Add(new LoginHelper.ControlNames(txtCPMC.ID, "CPMC"));
            lstControls.Add(txtCPMC);

            LoginHelper.LoadData(login_Info, lstCtl, lstControls);

            BindJCFF(drpCLZL.SelectedValue, drpRYZL.SelectedValue, drpJQFS.SelectedValue, txtSCRQ.Text.Trim());

            string strJYXM = "";
            LoginHelper.ConfirmJCXS(login_Info, "P", rbtnTest, lblJCCS, out strJYXM);

            if (rbtnTest.SelectedValue == "0")
            {             

                strJYXM = login_Info.JYXM;
            }

            if (!string.IsNullOrEmpty(strJYXM) && strJYXM.Substring(0, 1) == "X")
            {
                try
                {
                    string strValue = login_Info.JYXM.Substring(0, login_Info.JYXM.Length - 1);
                    rbtnJCFF.SelectedValue = strValue;
                }
                catch (Exception ex)
                { }
            }

            btnSave.Enabled = true;
            btnSave.CssClass = "btnSaveEnabled";
        }

        protected void btnReset_Click(object sender, EventArgs e)
        {
            ResetAll();
        }

        protected void btnSend_Click(object sender, EventArgs e)
        {
            bool bIsFirstTest_PQ = rbtnTest.SelectedValue == "0" ? true : false;//是否为初检
            //bool bHasCharge = LoginHelper.HasCharge(hidID.Value, "P", bIsFirstTest_PQ);
            //if (!bHasCharge)
            //{
            //    gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "当前车辆没有收费，请收费后在发送！");
            //    return;
            //}

            LoginHelper.ResetAllValidate(GetType(), this);

            var dicCheckItems = LoginHelper.CheckAllInputItems(hidID.Value, "", "P");
            if (dicCheckItems["P"].Count > 0)
            {
                foreach (var v in dicCheckItems["P"])
                {
                    TextBox txt = (TextBox)this.FindControl(v);
                    txt.BackColor = Color.Yellow;
                }
                return;
            }

            LOGIN_VEHICLE_INFO_BLL info_bll = new LOGIN_VEHICLE_INFO_BLL();
            var info = info_bll.GetModel(Convert.ToInt32(hidID.Value));
            if (string.IsNullOrEmpty(info.JYXM))
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "请选择检验项目保存后，在进行发送！");
                return;
            }

            bool bIsUpdate_PQ;
            VEHICLE_DISPATCH model_PQ = LoginHelper.GetDispathchByLoginID(hidID.Value, "P", bIsFirstTest_PQ, out bIsUpdate_PQ);

            VEHICLE_DISPATCH_BLL disBll = new VEHICLE_DISPATCH_BLL();

            if (!bIsUpdate_PQ)
            {
                if (disBll.Insert(model_PQ))
                {
                    gfAjaxJs.SetAlertMsg(UpdatePanel1, "发送成功！");
                    btnSend.CssClass = "btnSendDisabled";
                    btnSend.Enabled = false;
                    ResetAll();
                    LoginedList1.BindList("", "");
                    return;
                }
                else
                {
                    gfAjaxJs.SetAlertMsg(UpdatePanel1, "发送失败！");
                    btnSend.CssClass = "btnSendEnabled";
                    btnSend.Enabled = true;
                    return;
                }
            }
            else
            {
                if (disBll.Update(model_PQ, model_PQ.JCLSH))
                {
                    gfAjaxJs.SetAlertMsg(UpdatePanel1, "发送成功！");
                    btnSend.CssClass = "btnSendDisabled";
                    btnSend.Enabled = false;
                    ResetAll();
                    LoginedList1.BindList("", "");
                    return;
                }
                else
                {
                    gfAjaxJs.SetAlertMsg(UpdatePanel1, "发送失败！");
                    btnSend.CssClass = "btnSendEnabled";
                    btnSend.Enabled = true;
                    return;
                }
            }
        }


        protected void drpRYZL_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (drpRYZL.SelectedValue == "B")
            {
                drpPH.SelectedValue = "0#";
            }
            else
            {
                drpPH.SelectedValue = "92#";
            }

            BindJCFF(drpCLZL.SelectedValue, drpRYZL.SelectedValue, drpQDFS.SelectedValue, txtSCRQ.Text.Trim());
        }

        protected void drpQDFS_SelectedIndexChanged(object sender, EventArgs e)
        {
            BindJCFF(drpCLZL.SelectedValue, drpRYZL.SelectedValue, drpQDFS.SelectedValue, txtSCRQ.Text.Trim());
        }

        protected void btnFilter_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtSCRQ.Text) == true)
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "生产日期不能为空！");
                txtSCRQ.Focus();
                return;
            }
            BindJCFF(drpCLZL.SelectedValue, drpRYZL.SelectedValue, drpQDFS.SelectedValue, txtSCRQ.Text.Trim());
        }

        protected void btnSearchPPXH_Click(object sender, EventArgs e)
        {
            string strPPGC = txtPP.Text.Trim();
            string strXHGC = txtXH.Text.Trim();
            TYPE_CX_CONTENT_BLL bll = new TYPE_CX_CONTENT_BLL();
            TYPE_CX_CONTENT[] m_TYPE_CX_CONTENT = bll.GetModelList("PP='" + strPPGC + "' and XH='" + strXHGC + "' order by ID desc");

            if (m_TYPE_CX_CONTENT.Length > 0)
            {
                TYPE_CX_CONTENT vContent = m_TYPE_CX_CONTENT[0];

                List<LoginHelper.ControlNames> lstCtl = new List<LoginHelper.ControlNames>();
                List<Control> lstControls = new List<Control>();

                lstCtl.Add(new LoginHelper.ControlNames(drpCLZL.ID.ToString(), "CLZL"));
                lstControls.Add(drpCLZL);

                lstCtl.Add(new LoginHelper.ControlNames(txtZZL.ID.ToString(), "ZZL"));
                lstControls.Add(txtZZL);

                lstCtl.Add(new LoginHelper.ControlNames(txtZBZL.ID.ToString(), "ZBZL"));
                lstControls.Add(txtZBZL);

                lstCtl.Add(new LoginHelper.ControlNames(txtHZRS.ID.ToString(), "CYS"));
                lstControls.Add(txtHZRS);

                lstCtl.Add(new LoginHelper.ControlNames(chkQDZWZ.ID.ToString(), "QDZWZ"));
                lstControls.Add(chkQDZWZ);

                lstCtl.Add(new LoginHelper.ControlNames(txtCPMC.ID.ToString(), "CPMC"));
                lstControls.Add(txtCPMC);

                LoginHelper.GetPPXH(vContent, lstCtl, lstControls);
            }
        }

        protected void chkQDZWZ_SelectedIndexChanged(object sender, EventArgs e)
        {
            bool b = false;
            for (int i = 0; i < chkQDZWZ.Items.Count; i++)
            {
                if (chkQDZWZ.Items[i].Selected)
                {
                    b = true;
                }
            }

            if (b == false)
            {
                gfAjaxJs.SetAlertMsg(this.UpdatePanel1, "必须选择一个驱动轴！");
                chkQDZWZ.Items[1].Selected = true;
                return;
            }
        }

        protected void drpCLZL_SelectedIndexChanged(object sender, EventArgs e)
        {
            BindJCFF(drpCLZL.SelectedValue, drpRYZL.SelectedValue, drpQDFS.SelectedValue, txtSCRQ.Text.Trim());
        }

        protected void btnSearchFDJXH_Click(object sender, EventArgs e)
        {
            string strFDJXH = txtFDJXH.Text.Trim();

            TYPE_FDJ_CONTENT_BLL bll = new TYPE_FDJ_CONTENT_BLL();
            TYPE_FDJ_CONTENT[] m_TYPE_FDJ_CONTENT = bll.GetModelList("FDJXH='" + strFDJXH + "' order by ID desc");

            if (m_TYPE_FDJ_CONTENT.Length > 0)
            {
                TYPE_FDJ_CONTENT vContent = m_TYPE_FDJ_CONTENT[0];

                List<LoginHelper.ControlNames> lstCtl = new List<LoginHelper.ControlNames>();
                List<Control> lstControls = new List<Control>();

                lstCtl.Add(new LoginHelper.ControlNames(drpRYZL.ID, "RLLB"));
                lstControls.Add(drpRYZL);

                lstCtl.Add(new LoginHelper.ControlNames(txtEDGL.ID, "EDGL"));
                lstControls.Add(txtEDGL);

                lstCtl.Add(new LoginHelper.ControlNames(txtSCC.ID, "FDJZZC"));
                lstControls.Add(txtSCC);

                lstCtl.Add(new LoginHelper.ControlNames(drpGYFS.ID, "GYFS"));
                lstControls.Add(drpGYFS);

                lstCtl.Add(new LoginHelper.ControlNames(drpJQFS.ID, "JQFS"));
                lstControls.Add(drpJQFS);

                lstCtl.Add(new LoginHelper.ControlNames(txtEDNJZS.ID, "EDNJZS"));
                lstControls.Add(txtEDNJZS);

                lstCtl.Add(new LoginHelper.ControlNames(txtPL.ID, "FDJPL"));
                lstControls.Add(txtPL);

                lstCtl.Add(new LoginHelper.ControlNames(drpPH.ID, "RYBH"));
                lstControls.Add(drpPH);

                lstCtl.Add(new LoginHelper.ControlNames(txtQGS.ID, "FDJGS"));
                lstControls.Add(txtQGS);

                LoginHelper.GetFDJXH(vContent, lstCtl, lstControls);
            }
        }

        protected void lbtnLoginedShow_Click(object sender, EventArgs e)
        {
            if (divLoginList.Visible == false)
            {
                lbtnLoginedShow.Text = "收 起︽";
                divLoginList.Visible = true;
            }
            else
            {
                lbtnLoginedShow.Text = "展 开︾";
                divLoginList.Visible = false;
            }
        }
    }
}